import fetch from '@/utils/fetch';
import { ajax } from '@/utils/trip/ajax'
//添加数据信息
export function addApi(obj) {
    return fetch({
      url: '/api/admin/sys/api/',
      method: 'post',
      data: obj
    });
}

//导出
export function getApiExcel() {
    return fetch({
      url: '/api/admin/sys/api/excel',
      method: 'get',
    });
}
//导入Excel
export function putApiExcel(obj) {
    return fetch({
      url: '/api/admin/sys/api/excel',
      method: 'put',
      data: obj
    });
}
export function geApiExcelTemplate() {
    return fetch({
      url: '/api/admin/sys/api/excel',
      method: 'get',
    });
}
//删除信息
export function deleteAllApi(ids) {
  console.log("ids===="+ids);
    return fetch({
      url: '/api/admin/sys/api/list',
      method: 'delete',
      data:ids
    });
}
export function listAllPayCostRule() {
    return fetch({
      url: '/api/admin/sys/api/list',
      method: 'get',
    });
}
//API管理分页查询
export function getApiTable(query) {
    return fetch({
      url: '/api/admin/sys/api/pageList',
      method: 'get',
      params:query
    });
}
export function delPayCostRule(id) {
    return fetch({
      url: '/api/admin/sys/api/'+id,
      method: 'delete',
    });
}
//获取信息详情
export function getApi(id) {
    return fetch({
      url: '/api/admin/sys/api/'+id,
      method: 'get',
    });
}
//修改信息
export function putApi(id,obj) {
    return fetch({
      url: '/api/admin/sys/api/'+id,
      method: 'put',
      data:obj
    });
}
